﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>组织机构</title>
    <link rel="stylesheet" href="@ViewBag.easyuiTheme" id="easyuiTheme" />
    <link rel="stylesheet" href="@Url.Content("~/Content/list.css")" />
    @Styles.Render("~/style-easyui")

</head>
<body class="easyui-layout">
    <div data-options="region:'north',border:false,split:false" style="height:30px;" id="datahead">
        @*<div class="SearchBar">
                <div class="left">
                    @ViewBag.Title
                </div>
                <div class="toolbar">
                    <a class="searchbtn">搜索</a>
                    <div class="drop"></div>
                    <input type="text" class="box" />
                </div>
                <div class="right">
                </div>
            </div>*@
    </div>
    <div data-options="region:'center',border:false">
        <table id="tt"></table>
    </div>

    <div class="searchbox">
        <div>
            <input id="txt_FullName" type="text" class="easyui-textbox" label="全称：" />
        </div>
        <div>
            <input id="txt_Code" type="text" class="easyui-textbox" label="编号：" />
        </div>
        <div>
            <input id="txt_ShortName" type="text" class="easyui-textbox" label="简称：" />
        </div>
        <div>
            <select id="ddl_TypeName" class="easyui-combobox" label="类型：" style="width: 185px;" data-options="panelHeight:'auto'">
                <option value="">机构类型</option>
                <option value="04">普通部门</option>
                <option value="01">分支机构</option>
            </select>
        </div>
        <div>
            <select id="ddl_IsDisable" class="easyui-combobox" label="状态：" style="width:185px;" data-options="panelHeight:'auto'">
                <option value="">机构状态</option>
                <option value="0">正常</option>
                <option value="1">停用</option>
            </select>
        </div>
    </div>

    @*<div id="dlg" class="easyui-dialog" style="width: 600px; height: 280px; background-color: White;"
             buttons="#dlg-buttons">
            <table class="TableInfo" style="width: 95%; margin: 5px; display: none" align="center"
                   id="TableInfo">
                <tr>
                    <td class="TableContent" align="right" style="width: 80px">
                        上级：
                    </td>
                    <td class="TableData" style="width: 220px">
                        <label id="lbParentOrgan">
                        </label>
                    </td>
                    <td class="TableContent" align="right" style="width: 80px">
                        类型：
                    </td>
                    <td class="TableData" style="width: 220px">
                        <label id="lbOrganType">
                        </label>
                    </td>
                </tr>
                <tr>
                    <td class="TableContent" align="right">
                        全称：
                    </td>
                    <td class="TableData">
                        <label id="lbFullName">
                        </label>
                    </td>
                    <td class="TableContent" align="right">
                        编号：
                    </td>
                    <td class="TableData">
                        <label id="lbCode">
                        </label>
                    </td>
                </tr>
                <tr>
                    <td class="TableContent" align="right">
                        简称：
                    </td>
                    <td class="TableData">
                        <label id="lbShortName">
                        </label>
                    </td>
                    <td class="TableContent" align="right">
                        序号：
                    </td>
                    <td class="TableData">
                        <label id="lbSort">
                        </label>
                    </td>
                </tr>
                <tr>
                    <td class="TableContent" align="right">
                        电话：
                    </td>
                    <td class="TableData">
                        <label id="lbTel">
                        </label>
                    </td>
                    <td class="TableContent" align="right">
                        传真：
                    </td>
                    <td class="TableData">
                        <label id="lbFax">
                        </label>
                    </td>
                </tr>
                <tr>
                    <td class="TableContent" align="right">
                        税号：
                    </td>
                    <td class="TableData">
                        <label id="lbTaxNum">
                        </label>
                    </td>
                    <td class="TableContent" align="right">
                        银行：
                    </td>
                    <td class="TableData">
                        <label id="lbBank">
                        </label>
                    </td>
                </tr>
                <tr>
                    <td class="TableContent" align="right">
                        账号：
                    </td>
                    <td class="TableData">
                        <label id="lbAccountNum">
                        </label>
                    </td>
                    <td class="TableContent" align="right">
                        状态：
                    </td>
                    <td class="TableData">
                        <label id="lbStatus">
                        </label>
                    </td>
                </tr>
            </table>
        </div>*@


    @Scripts.Render("~/script-easyui")
    <script type="text/javascript" src="@Url.Content("~/Scripts/public.js")"></script>
    <script type="text/javascript">

        $(function () {
            initGrid();
            initSearchBar();
        });

        function initGrid() {
            $("#tt").initGrid({
                url: '/Organ/InitGrid',

                queryParams: {
                    ParentID: getQueryString("ParentID"),
                    Search: encodeURI($.trim($("#txt_Search").val())),
                    FullName: encodeURI($.trim($("#txt_FullName").val())),
                    Code: encodeURI($.trim($("#txt_Code").val())),
                    ShortName: encodeURI($.trim($("#txt_ShortName").val())),
                    TypeID: $("#ddl_TypeName").val(),
                    IsDisable: $("#ddl_IsDisable").val()
                },

                columns: [[
                    { field: 'ck', checkbox: true, width: 50 },
                    {
                        field: 'FullName', title: '全称', width: 150, sortable: true,
                        formatter: function (value, rowData, rowIndex) {
                            var a = "<a href=javascript:view(\'" + rowData.ID + "\')>" + rowData.FullName + "</a>"; return a;
                        }
                    },
                    { field: 'Code', title: '编号', width: 150, sortable: true },
                    { field: 'ShortName', title: '简称', width: 150, sortable: true },

                    { field: 'TypeName', title: '类型', width: 150, sortable: true, },
                    { field: 'IsDisable', title: '状态', width: 40, sortable: true },

                    { field: 'Sort', title: '排序号', width: 40, sortable: true, align: 'right' },
                    { field: 'action', title: '操作', width: 100, align: 'center' },
                ]],
                sortName: "Sort"
            });
        }

        function initSearchBar() {
            $("#datahead").initSearchBar({
                title: "@ViewBag.Title",
                buttonList:
                [
                    { id: "btnOut", text: "导出", options: "plain:true,iconCls:'icon-undo'", callback: function () { alert(1); } },
                    { id: "btnInput", text: "导入", options: "plain:true,iconCls:'icon-redo'", callback: function () { alert(2); } }
                ],
                btnDelcallback: function () { $("#tt").deleteCallBack({ idValue: "ID", action: "/Organ/Delete" }) }
            });
        }

    </script>
</body>
</html>
